var xtMonitorWinDetail;
var xtMonitorFormDetail;
function detailXtMonitor(){
	var record = grid.getSelectionModel().selected;
	if(record.length == 0){
		msgTishi('请选择要查看明细的项！');
		return;
	}
	initXtMonitorFormDetail();
	xtMonitorWinDetail = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'明细信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtMonitorFormDetail,
		buttons:[{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtMonitorWinDetail.show();
	loadFormData(xtMonitorFormDetail,'../xtMonitorController/getXtMonitorById?xt_monitor_id='+ record.items[0].data.xt_monitor_id);
}
function initXtMonitorFormDetail(){
	xtMonitorFormDetail = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'top',
			flex:1,
			readOnly:true,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'编号',
			xtype:'textfield',
			hidden:true,
			name:'xt_monitor_id',
			allowBlank:false,
			maxLength:32,
			anchor:'40%'
		},
		{
			fieldLabel:'用户名',
			xtype:'textfield',
			name:'xt_monitor_userName',
			maxLength:120,
			anchor:'40%'
		},
		{
			fieldLabel:'用户的账户名称',
			xtype:'textfield',
			name:'xt_monitor_accountName',
			maxLength:120,
			anchor:'40%'
		},
		{
			fieldLabel:'计算机名',
			xtype:'textfield',
			name:'xt_monitor_comName',
			maxLength:100,
			anchor:'40%'
		},
		{
			fieldLabel:'本地主机名',
			xtype:'textfield',
			name:'xt_monitor_localName',
			maxLength:100,
			anchor:'40%'
		},
		{
			fieldLabel:'JVM可以使用的总内存（M）',
			xtype:'numberfield',
			value:'0',
			name:'xt_monitor_jvm_totalMem',
			anchor:'40%'
		},
		{
			fieldLabel:'JVM可以使用的剩余内存（M）',
			xtype:'numberfield',
			value:'0',
			name:'xt_monitor_jvm_Mem',
			anchor:'40%'
		},
		{
			fieldLabel:'操作系统的名称',
			xtype:'textfield',
			name:'xt_monitor_operate_sysName',
			maxLength:120,
			anchor:'40%'
		},
		{
			fieldLabel:'操作系统的构架',
			xtype:'textfield',
			name:'xt_monitor_operate_org',
			maxLength:100,
			anchor:'40%'
		},
		{
			fieldLabel:'JVM可以使用的处理器个数',
			xtype:'numberfield',
			value:'0',
			name:'xt_monitor_jvm_cup_count',
			anchor:'40%'
		},
		{
			fieldLabel:'本地IP地址',
			xtype:'textfield',
			name:'xt_monitorIP',
			maxLength:55,
			anchor:'40%'
		},
		{
			fieldLabel:'Java的运行环境版本',
			xtype:'textfield',
			name:'xt_monitor_environment',
			maxLength:100,
			anchor:'40%'
		},
		{
			fieldLabel:'Java的安装路径',
			xtype:'textfield',
			name:'xt_monitorPath',
			maxLength:500,
			anchor:'80%'
		}
		]
	});
}
